<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>编辑商家</title>


<link href="${base}/resources/admin/css/amazeui.css" rel="stylesheet" type="text/css" /><link href="${base}/resources/admin/css/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/resources/admin/js/jquery.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/jquery.tools.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/jquery.validate.js"></script>
<script type="text/javascript" src="${base}/resources/admin/editor/kindeditor.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/common.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/input.js"></script>
<script type="text/javascript">
$().ready(function() {

	var $inputForm = $("#inputForm");
	var $browserButton = $("#browserButton");
    var $browserButton2 = $("#browserButton2");
	
	[@flash_message /]
	
	$browserButton.browser();
    $browserButton2.browser();
	
	// 表单验证
	$inputForm.validate({
        rules: {
            username: "required",
            name: "required",
            rePassword: {
                equalTo: "#password"
            },
            proportion:"required"
        }
	});
	
});
</script>
</head>
<body>
	<div class="path">
		<a href="${base}/asl-admin/common/index.htm">${message("admin.path.index")}</a> &raquo; 编辑商家
	</div>
	<form id="inputForm" action="update.htm" method="post">
		<input type="hidden" name="id" value="${merchant.id}" />
		<table class="input">
            <tr>
                <th>
                    <span class="requiredField">*</span>商家账号:
                </th>
                <td>
					${merchant.username}
                </td>
            </tr>
            <tr>
                <th>
                    <span class="requiredField">*</span>推荐码:
                </th>
                <td>
                    ${merchant.code}
                </td>
            </tr>
            <tr>
                <th>
                    logo:
                </th>
                <td>
					<span class="fieldSet">
						<input type="text" name="logo" class="text" maxlength="200" title="选择商家logo" value="${merchant.logo}" />
						<input type="button" id="browserButton" class="button" value="${message("admin.browser.select")}" />
                    [#if merchant.logo??]
                        <img src="${merchant.logo}" class="browserImage" />
                    [/#if]
					</span>
                </td>
            </tr>
            <tr>
                <th>
                    banner:
                </th>
                <td>
					<span class="fieldSet">
						<input type="text" name="banner" class="text" maxlength="200" title="选择商家banner" value="${merchant.banner}" />
						<input type="button" id="browserButton2" class="button" value="${message("admin.browser.select")}" />
                    [#if merchant.banner??]
                        <img src="${merchant.banner}" class="browserImage" />
                    [/#if]
					</span>
                </td>
            </tr>
            <tr>
                <th>
				 密码:
                </th>
                <td>
                    <input type="password" id="password" name="password" class="text" maxlength="20" title="${message("admin.member.passwordTitle")}" />
                </td>
            </tr>
            <tr>
                <th>
				确定密码:
                </th>
                <td>
                    <input type="password" name="rePassword" class="text" maxlength="20" />
                </td>
            </tr>
            <tr>
                <th>
                    <span class="requiredField">*</span>商家名:
                </th>
                <td>
                    <input type="text" name="name" class="text" maxlength="200" value="${merchant.name}" />
                </td>
            </tr>
            <tr>
                <th>
                    <span class="requiredField">*</span>商家余额:
                </th>
                <td>
                    ${merchant.balance}
                </td>
            </tr>
            <tr>
                <th>
                    <span class="requiredField">*</span>商家分润百分比:
                </th>
                <td>
                    <input type="text" name="proportion" class="text" maxlength="200" value="${merchant.proportion}"  /> 请输入0~1的比例
                </td>
            </tr>
            <tr>
                <th>
                ${message("admin.common.setting")}:
                </th>
                <td>
                    <label>
                        <input type="checkbox" name="isEnabled" value="true"[#if merchant.isEnabled] checked="checked"[/#if] />${message("Member.isEnabled")}
                        <input type="hidden" name="_isEnabled" value="false" />
                    </label>
                [#if merchant.isLocked]
                    <label>
                        <input type="checkbox" name="isLocked" value="true" checked="checked" />${message("Member.isLocked")}
                        <input type="hidden" name="_isLocked" value="false" />
                    </label>
                [/#if]
                </td>
            </tr>
            <tr>
                <th>
                    商家详情:
                </th>
                <td>
                    <textarea id="editor" name="intro" class="editor" style="width: 100%;height: 999px">${merchant.intro}</textarea>
                </td>
            </tr>
			<tr>
				<th>
					&nbsp;
				</th>
				<td>
					<input type="submit" class="button" value="${message("admin.common.submit")}" />
					<input type="button" class="button" value="${message("admin.common.back")}" onclick="location.href='list.htm'" />
				</td>
			</tr>
		</table>
	</form>
</body>
</html>
